fix(grammars): restore backslash escaping in llama31 grammar fixture - #11242
Merged
Conversation
PR #11041 rewrote the testllama31inputResult1 fixture and un-escaped the backslashes inside its Go raw-string literal, turning `[^"\\]` into `[^"\]` and `["\\/bfnrt]` into `["\/bfnrt]`. The fixture is compared line-by-line against the grammar built from PRIMITIVE_RULES in bnf_rules.go, which is unchanged and still emits the doubled form, so "generates a valid grammar from JSON schema" fails on every platform. Restore the four fixture lines to their pre-#11041 form. The cyclic $ref and depth specs added by that PR are untouched. The regression reached master because only the DCO check ever reported on #11041; its test runs were cancelled during the CI purge. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude Code:claude-opus-5[1m] [Bash] [Edit]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
masteris red. Thetestsworkflow fails on bothtests-linuxandtests-applewith a single spec:It is deterministic (all 5
--flake-attemptsfail) and currently blocks every open PR, including theupdate/LLAMA_VERSION,update/IK_LLAMA_VERSION,update/CRISPASR_VERSIONandupdate/AUDIO_CPP_VERSIONdependency bumps, none of which touch this code.Root cause
#11041 (
37f2087f9) rewrote thetestllama31inputResult1fixture and un-escaped the backslashes inside its Go raw-string literal:In a backtick literal those are literal characters, so the expectation changed from
[^"\\]to[^"\]. The fixture is compared line-by-line viaContainSubstringagainst the grammar built fromPRIMITIVE_RULESinpkg/functions/grammars/bnf_rules.go, which is unchanged since May and still emits the doubled form. The expectation therefore can never match.The sibling
json_schema_test.gostill carries the correct[^"\\], which is why only this one spec fails.Fix
Restore the four fixture lines to their pre-#11041 form. The cyclic
$refand depth-limit specs added by #11041 are untouched and still pass, so the security fix in that PR is fully preserved.The fixture is now byte-identical to its pre-#11041 state (verified with
git diff 37f2087f9^ -- pkg/functions/grammars/llama31_schema_test.go).How this reached master
gh pr checks 11041shows only the DCO check ever reported on that PR. Its test runs were cancelled during the CI purge, so it merged without thetestsgate.Verification
gofmt -landgo vetclean. Test-only change, no user-facing behaviour, so no docs update applies.